# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-subunit
pkgver=1.4.2
pkgrel=5
pkgdesc="Python implementation of subunit test streaming protocol"
arch=('any')
license=('Apache')
url="https://launchpad.net/subunit"
depends=('python-extras' 'python-testtools')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-fixtures' 'python-hypothesis' 'python-testscenarios')
source=("https://github.com/testing-cabal/subunit/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('21413f0ed26f5f0572249ff4bcf948ea25d9185a1df73421836b9b21e11f323300f93a0275f0d64dc7c81a8e038fa0661a34f818bb038abf79c0637e051bc69e')

build() {
  cd subunit-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd subunit-$pkgver
  PYTHONPATH="$PWD/build/lib" python -m testtools.run subunit.test_suite || echo "Tests failed"
}

package() {
  cd subunit-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
